package com.atguigu.gmall.web.all.config;


import com.atguigu.gmall.common.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.ResultSet;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    public Result handleException(Exception e){

        Result<Object> fail = Result.fail();
        fail.setMessage(e.getMessage());
        return fail;
    }
}
